class Isbn < ActiveRecord::Base  
  def to_formatted_s
    ean_for_books + '-' + geo_zone + '-' + publisher + '-' + publisher_book_code
  end

  def ean_for_books
    digits[0..2]
  end

  def geo_zone
    digits[3..3]
  end

  def publisher
    digits[4..7]
  end
  
  def publisher_book_code
    digits[8..12]
  end
end
